<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                template="/parkTemplate.xhtml"
                xmlns:p="http://primefaces.org/ui">
    <ui:param name="tab" value="register"/>
    <ui:define name="tab-content">
        <h2>Wypełnij formularz, aby utworzyć nowe konto:</h2>
        <h:form>
            <rich:panel header="#{bundle['registration.data']}">
                <h:panelGrid columns="3">
                    <h:outputText value="#{bundle['client.email']}" />
                    <h:inputText value="#{validationBean.email}" id="email" style="margin-left: 40px">
                        <rich:validator />
                    </h:inputText>
                    <rich:message for="email" />

                    <h:outputText value="#{bundle['client.password']}" />
                    <h:inputSecret value="#{validationBean.password}" id="password" style="margin-left: 40px" >
                        <rich:validator />
                    </h:inputSecret>
                    <rich:message for="password" />
                </h:panelGrid>
            </rich:panel>
            <rich:panel header="#{bundle['registration.personalData']}">
                <h:panelGrid columns="3">
                    <h:outputText value="#{bundle['client.name']}" />
                    <h:inputText value="#{validationBean.name}" id="name">
                        <rich:validator />
                    </h:inputText>
                    <rich:message for="name" />

                    <h:outputText value="#{bundle['client.lastname']}" />
                    <h:inputText value="#{validationBean.lastName}" id="lastname">
                        <rich:validator />
                    </h:inputText>
                    <rich:message for="lastname" />

                    <h:outputText value="#{bundle['client.city']}" />
                    <h:inputText value="#{validationBean.city}" id="city">
                        <rich:validator />
                    </h:inputText>
                    <rich:message for="city" />

                    <h:outputText value="#{bundle['client.postcode']}" />
                    <h:inputText value="#{validationBean.zipCode}" id="postcode" size="5">
                        <rich:validator />
                    </h:inputText>
                    <rich:message for="postcode" />

                    <h:outputText value="#{bundle['client.street']}" />
                    <h:inputText value="#{validationBean.street}" id="street">
                        <rich:validator />
                    </h:inputText>
                    <rich:message for="street" />

                    <h:outputText value="#{bundle['client.nrhouse']}" />
                    <h:inputText value="#{validationBean.houseNumber}" id="houseNumber" size="3">
                        <rich:validator />
                    </h:inputText>
                    <rich:message for="houseNumber" />

                    <h:outputText value="#{bundle['client.localNumber']}" />
                    <h:inputText value="#{validationBean.localNumber}" id="localNumber" size="3">
                        <rich:validator />
                    </h:inputText>
                    <rich:message for="localNumber" />

                    <h:outputText value="#{bundle['client.nip']}" />
                    <h:inputText value="#{validationBean.nipNumber}" id="nipNumber" size="10">
                        <rich:validator />
                    </h:inputText>
                    <rich:message for="nipNumber" />

                    <h:outputText value="#{bundle['client.phone']}" />
                    <h:inputText value="#{validationBean.phone}" id="phone" size="10">
                        <rich:validator />
                    </h:inputText>
                    <rich:message for="phone" />
                </h:panelGrid>
            </rich:panel>
            <rich:panel header="#{bundle['registration.registryConfirm']}">
                <h:panelGrid columns="3">
                    <h:outputText value="" />
                    <h:selectBooleanCheckbox value="#{validationBean.agreed}" id="agreed" style="float:left">
                        <h:outputText value="#{bundle['registration.confirm']}" />
                        <rich:validator />
                    </h:selectBooleanCheckbox>
                    <rich:message for="agreed" />
                    <p:messages showDetail="true"/>  
                    <p:captcha label="Captcha" language="polish" theme="white" /> /> 
                    <f:facet name="footer">
                        <a4j:commandButton id="registry" value="#{bundle['registration.registry']}" action="#{validationBean.registry()}" 
                                           style="margin-left: 140px; font-weight: bold;"/>
                    </f:facet>
                </h:panelGrid>
            </rich:panel>
        </h:form>
    </ui:define>
</ui:composition>